#include "RelaPlayerMgr.h"
#include "ProtoDispatch.h"
#include "Game.pb.h"
#include "dbProto/dbTableDef.h"
#include "stl_boost.h"
#include "../RelaSvr.h"
#include "db_driver/db_driver.h"
#include "RelaPlayer.h"


RelaPlayer::RelaPlayer(uint64_t id)
	:m_Net(*this)
	,m_FriendSys(*this)
{
}

RelaPlayer::~RelaPlayer()
{
	SaveDb();
}

void RelaPlayer::SaveDb()
{
	if (m_bDirty)
	{
		Dbproxy::Ins().Update(m_db);
		m_bDirty = false;
	}
}



void RelaPlayer::Touch()
{
	if(m_Net.m_state == LoginState::Logout)
	{
		m_Net.SetWaitRelease(true);
	}
}


